package core;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class Statistics {
	List<Double> error = new ArrayList<Double>(116);
	int variation = 0;
	int generation;
	public Statistics(int generation) {
		this.generation = generation;
	}
	public boolean addError(double error1) {
		return error.add(1/error1);
	}
	
	public double getAvg(){
		double resp = 0;
		for(Double d: error){
			resp +=d;
		}
		return resp/error.size();
	}
	
	public double findBest(){
		Collections.sort(error);
		return error.get(0);
	}
	
	public void addVariation(int var){
		variation = var;
	}
	
	public int getVariation(){
		return variation;
	}
}
